/**
* Description: 自定义loading页
*
* Created by hrx on 2024/1/31
*/
<template>
  <div class="my-loading" v-show="show">
    <div class="el-loading-spinner"><i style="font-size: 16px" class="el-icon-loading"></i>
      <div class="loading-text">{{text}}</div>
      <div class="close-btn">
        <div class="close" @click="closeLoading">
          关闭
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "loadingView",
  props:{
    text: {
      type: String,
      default: '正在上传...'
    },
    show: {
      type: Boolean,
      default(){
        return false
      }
    }
  },
  methods:{
    closeLoading(){
      this.$emit('closeLoading')
    }
  }
};
</script>

<style lang="less" scoped>
.my-loading {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2009;
  background-color: rgba(0, 0, 0, 0.7);
  .loading-text{
    color: #409EFF;
    margin: 3px 0;
    font-size: 14px;
    height: 15px;
    line-height: 15px;
  }
  .close-btn{
    margin-top: 10px;
    color: #409EFF;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    .close{
      border: 1px #409EFF solid;
      width: 50px;
      height: 25px;
      line-height: 25px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 11px;
    }
  }
}
</style>
